# -*- coding: utf-8 -*-
from selenium.webdriver.common.by import By

from config.config import Config

product_associated_task = str(Config().product_associated_task)
project_associated_task = str(Config().project_associated_task)
branch_rdc = {
    '分支管理列表': {
        '申请分支': [By.XPATH,'//div[@class="toolbar-button"]/i'],
        '搜索分支名称': [By.XPATH,'//*[@placeholder="分支名称、需求编号、关联环境"]'],
        '获取分支名称': [By.CSS_SELECTOR,'.features-name-cell-text'],
        '获取分支状态': [By.CSS_SELECTOR,'.el-tag--warning'],
        '更多分支信息': [By.CSS_SELECTOR,'.mp-icon-more'],
        '分支删除按钮': [By.CSS_SELECTOR,'.mp-icon-trash-2']
    },
    '申请分支页面':{
        '输入分支名称': [By.XPATH,'//*[@placeholder="请输入分支名称"]'],
        '点击关联任务': [By.XPATH,'//*[@placeholder="请选择关联任务"]'],
        '产品_选择关联任务2': [By.XPATH,f'//*[contains(text(),"{product_associated_task}")]'],
        '项目_选择关联任务2': [By.XPATH, f'//*[contains(text(),"{project_associated_task}")]'],
        '点击创建默认环境': [By.XPATH,'//*[@class="el-form-item__content"]/*[@class="el-checkbox"]/*[@class="el-checkbox__input"]'],
        '输入测试库名称': [By.XPATH,'//*[@placeholder="请输入测试库名称"]'],
        '保存': [By.XPATH,'//button/*[contains(text(),"保存")]']
    },
    '确认分支删除页面': {
        '输入特性分支名称': [By.XPATH,'//*[@placeholder="请输入特性分支名称"]'],
        '删除': [By.XPATH,'//*[@text="删除"]']
    }
}
